﻿using UnityEngine;
using System.Collections;

public class skyboxRandom : MonoBehaviour
{
	/// <summary>
	/// Getting the Materials for the Skyboxes.
	/// </summary>
	public Material skybox0;
	public Material skybox1;
	public Material skybox2;
	public Material skybox3;
	public Material skybox4;
	public Material skybox5;
	public Material skybox6;
	public Material skybox7;
	public Material skybox8;


	/// <summary>
	/// Constructor
	/// </summary>
	void Awake ()
	{
		pickSkybox (Random.Range (0, 9));
	}
	/// <summary>
	/// Gets the random number, and then assigns the skybox based on that.
	/// </summary>
	/// <param name="number">Number.</param>
	void pickSkybox (int number)
	{
		if (number == 0) {
			RenderSettings.skybox = skybox0;
		} else if (number == 1) {
			RenderSettings.skybox = skybox1;
		} else if (number == 2) {
			RenderSettings.skybox = skybox2;
		} else if (number == 3) {
			RenderSettings.skybox = skybox3;
		} else if (number == 4) {
			RenderSettings.skybox = skybox4;
		} else if (number == 5) {
			RenderSettings.skybox = skybox5;
		} else if (number == 6) {
			RenderSettings.skybox = skybox6;
		} else if (number == 7) {
			RenderSettings.skybox = skybox7;
		} else if (number == 8) {
			RenderSettings.skybox = skybox8;
		}

	}

}
